<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>KISSY gallery - Local Storage</title>
<link rel="shortcut icon" href="../../../../kissy-dpl/base/assets/favicon.ico"/>
<link rel="stylesheet" href="../../../../kissy-dpl/base/assets/reset.css"/>
<link rel="stylesheet" href="../../../../kissy-dpl/base/assets/kissy-docs.css"/>
<script src="http://docs.kissyui.com/kissy/build/kissy.js"></script>
<script src="../../../../kissy-dpl/base/assets/kissy-docs.js"></script>
<script>
    KISSY.config({
        packages:[
            {
                name:"gallery",
                tag:"20111220",
                path:"../../../",  // cdn上适当修改对应路径
                charset:"utf-8"
            }
        ]
    });
</script>
</head>
<body>
    <div id="header"> 
		<h1 class="logo"><a alt="KISSY" href="http://kissyui.com/"><img src="../../../../kissy-dpl/base/assets/logo.png"/></a></h1>
		<div class="sub-title">Gallery</div>
		<ul class="navigation"> 
			<li><a href="http://blog.kissyui.com/">博客</a></li> 
			<li><a href="http://github.com/kissyteam">源码</a></li> 		
		</ul>
		
	</div> 
    <div id="content">
		<div class="s-crumbs">
			<span>当前位置：</span>
			<a href="http://kissyui.com/">KISSY</a>
			<a href="../../../index.html">Gallery</a>
			<span>Local Storage</span>
		</div>
			<pre class="s-section">				
作者：林谦<linqian.zl@taobao.com> & &lt;yyfrankyy&gt; & 长天<changtian@taobao.com>
功能：function
描述：本地存储封装
源码：<a href="index.js">local-storage.js</a></pre>
			
			<h3 class="s-title">API</h3>			
			<div class="s-section">
				<h4 class="s-api-title">methods</h4>				
        <div>
          <pre>
 - localStorage.setItem(key, value)
 - localStorage.getItem(key)
 - localStorage.removeItem(key)
 - localStorage.clear()
          </pre>
        </div>
				<button id='t'>设置并查看本地存储</button>
				<script>
				    KISSY.use("gallery/local-storage/1.0/",function(S,localStorage){
				        S.one('#t').on("click",function(){
				            localStorage.setItem("one","one");
				            alert(localStorage.getItem("one"));
				        });				        
				    });
				</script>
			</div>
			
			<h3 class="s-title">Note</h3>			
			<div class="s-section">
				<ul class="s-list">
					<li>关于 localstorage 和 userData 限制: http://www.mytcer.com/865</li>
				</ul>
			</div>
    </div>
    <div id="footer">
        &copy; Copyright 2010~2011, KISSY Team.
    </div>
</body>
</html>
